﻿namespace Cloud.Test.File.Model.Res
{
    public class Result
    {
        public string? Msg { get; set; } = "操作成功!";

        public int Code { get; set; } = 200;

        public string Time { get { return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } }

        public object? Data { get; set; }

        public static async Task<Result> Success(){

            return  await Task.Run(()=> new Result());
        }
        public static async Task<Result> Success(object data)
        {

            return await Task.Run(() => new Result {Data = data });
        }
        public static async Task<Result> Error(int code,string? msg) { 
            return await Task.Run(()=> new Result { Code = code, Msg = msg });
        }


    }
}
